/*

import 'qr_cubit.dart';
import 'package:flutter/material.dart';

import 'package:syria_sports/core/app_export.dart';

class QRScreen extends StatelessWidget {
  final Function(Barcode)? onBarcodeDetected;

  const QRScreen({
    Key? key,
    this.onBarcodeDetected,
  }) : super(key: key);

  @override
  Widget build(BuildContext context) {
    double height = MediaQuery.of(context).size.height;
    double width = MediaQuery.of(context).size.width;

    return Scaffold(
      body: BlocProvider(
        create: (context) => QRCubit()..init(),
        child: BlocConsumer<QRCubit, QRState>(
          listener: (context, state) {
            // TODO: implement listener
          },
          builder: (context, state) {
            return SizedBox(
              height: height,
              width: width,
              child: Stack(
                children: [
                  BarcodeScannerWidget(
                    scannerType: ScannerType.barcode,
                    startScanning: true,
                    stopScanOnBarcodeDetected: false,
                    onBarcodeDetected: (barcode) async {
                      onBarcodeDetected?.call(barcode);
                      debugPrint("onBarcodeDetected ${barcode.value}");
                    },
                    onTextDetected: (String text) async {

                    },
                    onError: (dynamic error) {
                      //debugPrint('$error');
                    },
                  ),
                  Center(
                    child: Container(
                      height: height,
                      width: width,
                      decoration: BoxDecoration(
                        borderRadius: BorderRadius.circular(0),
                        color: Colors.transparent,
                        border: Border(
                          bottom: BorderSide(
                              color: Colors.black38, width: height / 2 - 120),
                          top: BorderSide(
                              color: Colors.black38, width: height / 2 - 120),
                          left: BorderSide(
                              color: Colors.black38, width: width / 2 - 120),
                          right: BorderSide(
                              color: Colors.black38, width: width / 2 - 120),
                        ),
                      ),
                    ),
                  ),
                  Align(
                    alignment: Alignment.center,
                    child: Image.asset(
                      ImageConstant.imgScannerBorderIcon,
                      color: Colors.white,
                    ),
                  ),
                  Align(
                    alignment: Alignment.topCenter,
                    child: Column(
                      children: [
                        AppBar(
                          backgroundColor: Colors.transparent,
                          shadowColor: Colors.transparent,
                          centerTitle: true,
                          actions: [
                            IconButton(
                              onPressed: () {},
                              focusColor: Colors.transparent,
                              color: Colors.transparent,
                              hoverColor: Colors.transparent,
                              disabledColor: Colors.transparent,
                              highlightColor: Colors.transparent,
                              enableFeedback: false,
                              splashColor: Colors.transparent,
                              icon: const Icon(
                                Icons.add,
                                color: Colors.transparent,
                              ),
                            ),
                          ],
                        ),
                        const SizedBox(
                          height: 32,
                        ),
                        Text(
                          'امسح الكود الموجود على بطاقة اللاعب',
                          style: theme.textTheme.titleMedium,
                        ),
                      ],
                    ),
                  ),
                ],
              ),
            );
          },
        ),
      ),
    );
  }
}
*/
